<?php
session_start();

$mysqli = new mysqli('localhost:3306','root','','boke');
// $mysqli = new mysqli('localhost:3306','liuboyto_root','#MySQLmima#618','liuboyto_618');
mysqli_query($mysqli,"set names utf8");
$username = $_POST["username"];
$password = $_POST["password"];
$email = $_POST["email"];
$sex = $_POST["sex"];
$yanzhengma = $_POST["yanzhengma"];

// $datetime = date("y-m-d h:i:sa");
$str = $_SESSION['str'];
// echo $content;
// echo $datetime;
if($yanzhengma===$str){
$sql = "insert into user values(null,'$username' ,'$password',default,'$sex','$email',now() ) ";
$res = $mysqli->query($sql);
echo "你的用户ID为：".mysqli_insert_id($mysqli)."!!!请记住这个ID，以免影响登录！";
// header("location:login.html");
?>
	<a href="login.html">去登录</a> 
<?php
}else{
	echo  "验证码错误";
	?>
	<a href="zhuce.html">返回</a> 
<?php	
}
$mysqli->close();


?>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
